<template>
  <div class="parameter-container">
    <h2 class="title">{{ goods.title }}</h2>
    <div class="price-container">
      <span class="old-price">{{ goods.oldPrice }}</span>&nbsp;
      <span class="real-price">￥{{ goods.realPrice }}</span>
      <span class="discount">{{ goods.discount }}</span>
    </div>
    <div class="num-container">
      <div class="num" v-for="(item, index) in goods.columns" :key="index">
        {{ item }}
      </div>
    </div>
    <div class="time-container">
      <div class="time" v-for="(item, index) in goods.services" :key="index">
        <img :src="item.icon" />
        <span>{{ item.name }}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    goods: {
      type: Object,
      default() {
        return {};
      },
    },
  },
};
</script>

<style scoped>
.parameter-container {
  padding: 10px;
}
.title {
  font-size: 16px;
}
.price-container {
  position: relative;
  margin: 15px 0 25px 0;
}
.old-price {
  font-size: 22px;
  color: var(--color-tint);
  font-weight: bold;
}
.real-price {
  color: var(--color-text);
  text-decoration: line-through var(--color-text);
}
.discount {
  display: inline-block;
  font-size: 12px;
  color: var(--color-background);
  background-color: var(--color-high-text);
  height: 22px;
  width: 45px;
  line-height: 22px;
  text-align: center;
  border-radius: 10px;
  margin-left: 5px;
  margin-bottom: 10px;
  position: absolute;
  top: -9px;
}
.num-container {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #f3f3f3;
}
.num {
  color: var(--color-text);
  margin-bottom: 5px;
}
.time-container {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
  width: 100%;
}
.time {
  height: 50px;
  line-height: 50px;
  width: 50%;
}
.time img {
  height: 15px;
  width: 15px;
}
</style>>
